/*
* StoppingVehicleDetection.h
* StoppingVehicleDetection Class
*
* author : T. D. Gamage
*/

#pragma once
#include <string>
#include <cv.h>
#include <highgui.h>
#include <fstream>
#include "Frame.h"
#include "SURFeatures.h"
#include "OpticalFlow.h"
#include <stdio.h>
#include <string.h>

using namespace std;
using namespace cv;

class StoppingVehicleDetection
{
private:  
    Frame* currentFrame;  
    Frame* previousSavedFrame; // used to find the stopped object

public:
    CvPoint prevoiusPoint;
    CvPoint currentPoint;
    CvPoint lastBoxPoint;
    CvPoint lastSavedPoint;
    bool saved;

    CvRect prevoiusComp_rect;
    CvRect currentComp_rect;
    IplImage *previousRegion;
    IplImage *currentRegion;
    bool check;
    double previousOpFlowAve;
    int vehicleCount;
    char* ipAddress;
     char fileName[80];
    ofstream outPutFile;
   
    
    StoppingVehicleDetection(char* ipAddress,IplImage* image);
    void setCurrentRegion(Frame* currentFrame,CvRect currentComp_rect,CvScalar color);
    void detectAndSave();
    virtual ~StoppingVehicleDetection(void);
};